package common

type Result[T any] struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Data *T     `json:"data"`
}

func Success[T any](data T) Result[T] {
	return Result[T]{Code: 0, Msg: "success", Data: &data}
}
func Fail[T any](msg string) Result[T] {
	return Result[T]{Code: 1, Msg: msg, Data: nil}
}
